<?php

namespace app\common\model\mall;

use think\Model;


class RefundLog extends Model
{
    // 表名
    protected $name = 'litestore_order_refund_log';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [];

    const REFUND_STATUS_APPLY = 0;//申请退款

    const REFUND_STATUS_CANCEL = 1;//取消申请

    const REFUND_STATUS_REFUSE = 2;//拒绝退款

    const REFUND_STATUS_WAIT_BUYER = 3;//等待买家发货

    const REFUND_STATUS_WAIT_SELLER = 4;//等待卖家收货

    const REFUND_STATUS_COMPLETE = 5;//已完成

    const OPERATE_TYPE_BUYER = 1;//买家

    const OPERATE_TYPE_SELLER = 2;//卖家

    public function getCreatetimeAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['createtime']) ? $data['createtime'] : '');
        return is_numeric($value) && $value ? date("Y-m-d H:i:s", $value) : $value;
    }
}
